<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="ISO-8859-1"%>
<%@page import="myJDBC.lowLevel.*"%>
<%@ page import="java.util.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<style>
<%@include file="smallJsps/styles.jsp" %>
</style>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<%@include file="smallJsps/bootstrapInclude.jsp" %>
</head>
<body>
<%@include file="smallJsps/logoutButton.jsp" %>
<%@include file="smallJsps/checkAdmin.jsp" %>
<div class="row-fluid">
		<div class="span6 offset2">
	<% 
	if (request.getAttribute("err") != null) {
			out.print("<h1>"+request.getAttribute("err")+"</h1>");
		}	
	 %>
	 	<h3>Choose type</h3>
	<form action="createObject2" name="form" method="POST">		
		<%
			int parentid=-1;
			if(request.getParameter("par")!=null){
				parentid=Integer.parseInt(request.getParameter("par"));
				out.print("<input type=\"hidden\" name=\"par\" value="+parentid+">");
			}
		 %>
		<label>type<br><select name="sel">
		<%
			ArrayList<String> listWithObjecttypes = new ArrayList<String>();
			listWithObjecttypes = ObjectTypes.returnObjectTypes();
			for (int i = 0; i < listWithObjecttypes.size(); i = i + 3) {						
				out.println("<option value="+listWithObjecttypes.get(i)+">" + listWithObjecttypes.get(i+1)+" || par="+listWithObjecttypes.get(i + 2)+ "</option>");
			}
		%>
		</select></label>
		<br>
		<input class="btn btn-large btn-primary" type="submit" value="Create">
	</form>
	<form method="get" action="privateOffice"><button class="btn" type="submit">privateOffice</button></form>
	</div>
	</div>
</body>
</html>